home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tool-inc.zip / BYTEFLAG.INC < prev    next >
Text File  |  1989-06-02  |  968b  |  36 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*
  14.  * byteflag.inc - Library to manipulate flag bits in a byte
  15.  *
  16.  *)
  17.  
  18. (* --------------------------------------------------------- *)
  19. function getbbit(bits: byte; bitval: byte): boolean;
  20.    {return true/false for specified is set}
  21. begin
  22.    getbbit := (bits and bitval) <> 0;
  23. end;
  24.  
  25. (* --------------------------------------------------------- *)
  26. procedure setbbit(var bits: byte; bitval: byte; value: boolean);
  27.    {set the specified bit in a bitmap}
  28. begin
  29.    if value then
  30.       bits := bits or bitval
  31.    else
  32.       bits := bits and (255 - bitval);
  33. end;
  34.  
  35.  
  36.